<?php
    $name = "";
    $birthdate ="";
    $gender = "";
    $address = "";
    $country ="";
    $favorite = "";
    $job = "";
    $company ="";
    $website ="";
    $more = "";
    
    if(!empty($profile)){
        $name = $profile->name;
        $birthdate = date('d/m/Y',$profile->birthdate);
        $gender = $profile->gender;
        $address = $profile->address;
        $country = $profile->country;
        $favorite = $profile->favorite;
        $job = $profile->job;
        $company = $profile->company;
        $website = $profile->website;
        $more = $profile->more;
    }
?>
<?php echo form_open('administrator/user/index/save') ?>
<div class="" id="myModal" >
  <div class="modal-header">
    <h3 style="text-transform: capitalize;"><?php echo $action ?> User</h3>
  </div>
  <?php if(empty($profile)):?>
<label for="username">User name</label><input type="text" name="username" id="username" />
    <label for="password">Password</label><input type="password" name="password" id="password" />
    <label for="email">Email</label><input type="text" name="email" id="email" />
<?php endif;?>
    <label for="name">Name</label><input type="text" name="name" id="name" value="<?php echo $name?>" />
    <label for="birthdate">Birthday</label><input type="text" name="birthdate" id="birthdate" value="<?php echo $birthdate?>"/>
    <label for="gender">Gender</label>
    <select name="gender">
        <option value="0" <?php echo $gender==0?"selected='selected'":"";?>>Male</option>
        <option value="1" <?php echo $gender==1?"selected='selected'":"";?>>Female</option>
    </select>
    <label for="address">Address</label><input type="text" name="address" id="address" value="<?php echo $address?>" />
    <label for="country">Country</label><input type="text" name="country" id="country" value="<?php echo $country?>"/>
    <label for="favorite">Favorite</label><input type="text" name="favorite" id="favorite" value="<?php echo $favorite?>" />
    <label for="job">Job</label><input type="text" name="job" id="job" value="<?php echo $job?>" />
    <label for="company">Company</label><input type="text" name="company" id="company" value="<?php echo $company?>" />
    <label for="website">Website</label><input type="text" name="website" id="website" value="<?php echo $website?>" />
    <label for="more">More</label><textarea name="more" id="more" class="ckeditor" class="large"><?php echo $more?></textarea>
     <div class="modal-footer">
    <input type="submit" class="btn btn-primary"  value="Save"/>
    <a href="<?php echo base_url().'/administrator/user/index/'?>" class="btn">Cancel</a>
    <input type="hidden" name="action"  value="<?php echo $action ?>" id="action" />
    <input type="hidden" name="user_id"  value="<?php echo $profile->user_id ?>" id="action" />
  </div> 
  </div>
</form>